import { useEffect } from "react";

export default function useDebounceEffect(effect: React.EffectCallback, deps?: React.DependencyList, delay?: number) {
    // 添加防抖功能
    useEffect(() => {
        const timeoutId = setTimeout(() => {
            const result = effect();
        }, delay)

        return () => {
            clearTimeout(timeoutId);
        }
    }, deps)
}